package com.max.xihu.patterns.single;

/**
 * @Author: Max
 * @Date: 2020-08-25 23:20
 * @Description:静态内部类
 */
public class SingletonStatic {

    //私有构造器
    private SingletonStatic (){}

    //全局访问点
    public static SingletonStatic getInstance() {
        return SingleHolder.INSTANCE;
    }

    //静态内部类
    private static class SingleHolder {
        private static final SingletonStatic INSTANCE = new SingletonStatic();
    }
}
